﻿<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-07-24 14:48:47
 * @LastEditTime: 2019-08-15 15:28:21
 * @LastEditors: Please set LastEditors
 -->
<f:layout name="Default" />
<f:section name="main">
<f:flashMessages />
<div class="portlet light ">
    <div class="portlet-title">
        <div class="caption">
            <f:if condition="{settings.listType}==0">
                <f:then>
                    <f:link.action action="new" class="btn btn-info">新增</f:link.action>
                </f:then>
                <f:else>
                    <f:link.action action="new" class="btn btn-info">新增</f:link.action>
                </f:else>
            </f:if>
        </div>
        <div class="actions">
            <div class="btn-group btn-group-devided">
                <f:form class="form-inline" action="list" object="{search}" name="search"  method="GET">
                    <div class="input-group">
                        <div class="input-icon">
                            <input type="hidden" name="id" value="{pageUid}" />
                            <i class="fa fa-search"></i>
                            <f:form.textfield name="keyword" value="{keyword}" class="form-control" placeholder="请输入查询条件" />
                        </div>
                        <span class="input-group-btn">
                            <f:form.submit class="btn btn-success" value="搜" />
                        </span>
                    </div>
                </f:form>
            </div>
        </div>
    </div>
    <f:widget.paginate objects="{newss}" as="newssPagination"  configuration="{settings.paginate}">
    <div class="portlet-body">
        <div class="table-scrollable">
            <table class="table table-hover table-light">
                <thead>
                    <tr class="uppercase">
                        <th></th>
                        <th>序号</th>
                        <th>标题</th>
                        <th>分类</th>
                        <th>发布时间</th>
                        <f:if condition="{settings.listType}==0">
                        	<th>置顶</th>
	                	</f:if>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <f:for each="{newssPagination}" as="news" iteration="itemIteration1">
                    <tr>
                        <td>
                            <label class="mt-checkbox mt-checkbox-outline">
                                <input type="checkbox" value="{news.uid}" name="test" class="normal sel" />
                                <span></span>
                            </label>
                        </td>
                        <td>
                        	{f:cObject(typoscriptObjectPath:'lib.calc', data:'{itemIteration1.cycle}+({page}-1)*{settings.paginate.itemsPerPage}')}
                        </td>
                        <td>
                            <f:link.action pageUid="{settings.previewPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : news}" target="_blank">
                                {news.title}
                            </f:link.action>
                        </td>
                        <td><f:for each="{news.categories}" as="category">
                                {category.title}
                            </f:for></td>
                        <td class="tc">{news.datetime -> f:format.date(format: 'Y-m-d H:i')}</td>
                        <f:if condition="{settings.listType}==0">
                        	<td>{f:if(condition: news.istopnews, then: '是', else: '否')}
                            </td>
	                	</f:if>
                        <td>
                            <!-- <f:link.action action="edit" additionalParams="{old_trans_id:news.uid,lang:'1',pageid:9}" controller="Trans" extensionName="translation" pluginName="pi1" pageUid="127" noCache="1" noCacheHash="1" class="btn btn-success btn-xs">翻译</f:link.action> -->
                            <f:link.action action="edit" arguments="{news : news}" class="btn btn-info btn-xs edit">编辑</f:link.action>
                            <f:link.action action="delete" arguments="{news : news}" class="btn btn-danger btn-xs delete btn-del">删除</f:link.action>
                        </td>
                    </tr>
                    </f:for>
                    <tr>
                        <td>
                            <label class="mt-checkbox mt-checkbox-outline">
                                <input type="checkbox" name="test" class="normal selectall" />
                                <span></span>
                            </label>
                        </td>
                        <td colspan="6">
                            <f:form action="multidelete" name="datas">
                                <f:form.hidden id="multidelete-items" property="items" value=""/>
                                <f:form.submit value="删除选中" class="btn btn-danger btn-xs delete btn-del btn-delete-all"/>
                            </f:form>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    </f:widget.paginate>
</div>
</f:section>
